<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>IFrame responder</title>
  <script>
    var targetOrigin = window.location.origin;

    window.parent.postMessage({
      mceAction: 'custom',
      message: 'First message'
    }, targetOrigin);

    // Setup a listener to receive messages and return the message back
    window.addEventListener('message', function (e) {
      window.parent.postMessage({
        mceAction: 'reply',
        data: e.data
      }, targetOrigin);
    });
  </script>
</head>
<body>
</body>
</html>